Skip to content

feat(use-cases): run a Lua snippet on every request with axon - #43

Merged
pigri merged 1 commit into
mainfrom
feat/axon-access
Nov 30, 2026
Merged

pigri merged 1 commit into
mainfrom
feat/axon-access

Conversation

@pigri

@pigri pigri commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

A proxy-mode example of axon, the Lua snippets that Synapse 0.8.10 adds: an access_by_axon snippet runs on every request the WAF allowed.

access.lua blocks /admin* with a 403, limits a client to 30 requests a minute with a shared dictionary, and tags a sqlmap user agent as scanner-ua in access.log. test.sh checks each of them against the running example.

Synapse builds axon only with the axon cargo feature, which is off by default. The README says so, and the compose file takes SYNAPSE_IMAGE for an image built with it.

Tested

Against a Synapse 0.8.10 build with --features axon:

  • synapse --check-config passes for the set, and reports a Lua syntax error in the snippet.
  • test.sh against a running instance: 5 of 5 checks pass.
  • Mutants, each a separate instance:
Mutant Checks that fail
snippet.enabled: false /admin blocked, scanner tag, rate limit
rate limit raised to 100000 rate limit
scanner pattern changed scanner tag
path pattern changed /admin blocked

Not run: the docker compose path, for want of a published image built with axon.

  • checks pass

Not reviewed: 4d4ab63 — examples and test scripts only

@pigri
pigri added this pull request to stack #45 November 15, 2026 21:47
@pigri
pigri marked this pull request as ready for review November 15, 2026 21:53
@pigri
pigri merged commit dc35025 into main Nov 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant